package com.tiancheng.trade.merchant.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Optional;

/**
 * @Author: kellen
 * @Description: 法人职业枚举
 * @Date: create in 2024/11/19 16:17
 */
@Getter
@AllArgsConstructor
public enum LegalOccupationEnums {
    jishu(0,"企业商户"),
    jiguan_danwei(1,"国家机关、党群组织、企事业单位的负责人"),
    banshi_youguan(2,"办事人员和有关人员"),
    shangye(3,"商业工作人员"),
    fuwuxing(4,"服务性工作人员"),
    nonglin(5,"农林牧渔劳动者"),
    shengchan_yunshu(6,"生产工作、运输工作和部分体力劳动者"),
    qita(7,"不便分类的其他劳动者");

    private final Integer code;
    private final String name;

    public static Optional<LegalOccupationEnums> getByCode(Integer code){
        return Arrays.stream(LegalOccupationEnums.values()).filter(m->m.getCode().equals(code)).findFirst();
    };
}
